package com.pda.service.impl;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson2.JSONObject;
import com.pda.service.IPdaService;
import com.cigar.common.core.domain.AjaxResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author wzh
 * @version 1.0
 * @data 2025/5/15 15:36
 */
@Service
@Slf4j
public class PdaServiceImpl implements IPdaService {

    // 请求地址
    String url = "";

    @Override
    public AjaxResult mainPda(Map<String, List<Map<String, Object>>> map) {
        // 盒/条 信息 集合
        List<Map<String, Object>> list = map.get("list");
        // 调用第三方接口 构建请求参数
        Map<String, Object> requestBody = new HashMap<>();

        requestBody.put("list",list);
        log.info("修改件码运输方式请求参数：{}", JSONObject.toJSONString(requestBody));
        HttpResponse responseBody =
                HttpRequest
                        .post(url)
                        .body(JSONObject.toJSONString(requestBody))
                        .execute();
        return null;
    }
}
